// Arquivo para constantes ygo
package ygo

const(
	//COP0
	EX_ADES = 4; //Erro de endereço de Store Exception
	EX_INTERRUPTION = 0;

	//OpCodes
	SPECIAL = 0; //tipo de instruções especiais
		ADD = 32;
		AND = 36;
		SUB = 34;
	ADDI  = 8;
	J = 2;
	BEQ = 4;
	LW = 35;
	SW = 43;

	//Register
	RRS_RRT_WRD = 1;
	RRS_WRT = 2;
	RRS_RRT= 3;
	
	//cp0command
	NOTHING = 0
	EXCEPTION_RETURN = 1
	WAIT_EXCEPTION = 2
	WAIT_INTERRUPTION = 3
	MOVE_TO_CP0 = 4
	MOVE_FROM = 5
	SYSCALL = 6
	
	ALU;

	// PC_ADDRESSES
	NORMAL_EXCEPTION_ADDRESS = 0x80000000 + 0x180
	BS_EXCEPTION_ADDRESS = 0xBFC00200 + 0x180
	IV_NORMAL_ADDRESS =0x80000000 + 0x200
	IV_BS_ADDRESS = 0xBFC00200 + 0x200
	//constant INSTRUCTION_SIZE : MR[4][16] := "0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0"[4];
	
	//Decode var
	YES = 1
	NO = 2
	IGNORE_JUMPS = 3

	//Decode states
	STATE_BRANCH_SENT = 1
	STATE_BRANCH_LIKELY_SENT = 2
	STATE_DELAY_SLOT_SENT = 3
	STATE_NULLIFY_NEXT = 4
	STATE_NULLIFY_NEXT_2 = 5
	STATE_NULLIFY_SECOND = 6
	STATE_OTHERS = 7

	//Decode command
	INTERRUPTION = 1
	CORE_INTERRUPTION = 2
	RETURN = 3
	CONTINUE = 4

	//PC command
	PC_NEXT = 1;
	PC_IMMEDIATE_JUMP = 2;
	PC_INTERRUPT = 3
	PC_INTERRUPT_IN_DS = 4
	PC_INTERRUPT_IN_MEMORY = 5
	PC_INTERRUPT_IN_EXEC = 6
	PC_RETURN = 7
	PC_DELAYED_BRANCH = 8
	PC_JUMP_REG = 9
	PC_LINK_AND_JUMP_REG = 10
	PC_BRANCH = 11
	PC_LINK_AND_BRANCH = 12
	PC_LINK_AND_NEXT = 13
	PC_LINK_AND_IMMEDIATE_JUMP = 14
	
	
	INSTRUCTION_SIZE = 1

	datainiciatial = "$timescale 1ns $end\n"+
	"$scope module yam $end\n"+

	"$var wire 1 req_ack_INST 	01#INST_reques $end\n"+
	"$var wire 32 cha_INST 		02#INST_chanel $end\n"+
	
	
	"$var wire 1 req_ack_DECO 	03#DECO_reques $end\n"+
	"$var wire 32 cha_DECO 		04#DECO_chanel $end\n"+
	
	"$var wire 1 req_ack_DERE 	07#DERE_reques $end\n"+
	"$var wire 32 cha_DERE 		08#DERE_chanel $end\n"+
	
	"$var wire 1 req_ack_DEDM 	13#DEDM_reques $end\n"+
	"$var wire 32 cha_DEDM 		14#DEDM_chanel $end\n"+
	
	"$var wire 1 req_ack_DEMU	09#DEMU_reques $end\n"+
	"$var wire 32 cha_DEMU 		10#DEMU_chanel $end\n"+
	
	"$var wire 1 req_ack_ALMU 	ALMU_reques $end\n"+
	"$var wire 32 cha_ALMU 		ALMU_chanel $end\n"+
	
	"$var wire 1 req_ack_MURE 	MURE_reques $end\n"+
	"$var wire 32 cha_MURE MURE_chanel $end\n"+
	
	"$var wire 1 req_ack_REDM 	REDM_reques $end\n"+
	"$var wire 32 cha_REDM 		REDM_chanel $end\n"+
	
	"$var wire 1 req_ack_DMAL	DMAL_reques $end\n"+
	"$var wire 32 cha_DMAL 		DMAL_chanel $end\n"+
	
	"$var wire 1 req_ack_DEPC 	11#DEPC_reques $end\n"+
	"$var wire 32 cha_DEPC 		12#DEPC_chanel $end\n"+
	
	"$var wire 1 req_ack_DEAL 	05#DEAL_reques $end\n"+
	"$var wire 32 cha_DEAL 		06#DEAL_chanel $end\n"+
	
	"$var wire 1 req_ack_LS_ADDR 	15#LS_ADDR_reques $end\n"+
	"$var wire 32 cha_LS_ADDR 	16#LS_ADDR_chanel $end\n"+
	
	"$var wire 1 req_ack_LS_RW 	17#LS_RW_reques $end\n"+
	"$var wire 32 cha_LS_RW		18#LS_RW_chanel $end\n"+
	
	"$var wire 1 req_ack_LS_DATA_IN 	19#LS_DATA_IN_reques $end\n"+
	"$var wire 32 cha_LS_DATA_IN 		20#LS_DATA_IN_chanel $end\n"+
	
	"$var wire 1 req_ack_LS_DATA_OUT 	21#LS_DATA_OUT_reques $end\n"+
	"$var wire 32 cha_LS_DATA_OUT 		22#LS_DATA_OUT_chanel $end\n"+
	
	
	
	"$upscope $end\n"+
	"$enddefinitions $end\n"+
	"$dumpvars\n"+
	"bx req_ack_DECO\n"+
	"bx cha_DECO\n"+
	
	"bx req_ack_DERE\n"+
	"bx cha_DERE\n"+
	
	"bx req_ack_DEDM\n"+
	"bx cha_DEDM\n"+
	
	"bx req_ack_DEMU\n"+
	"bx cha_DEMU\n"+
	
	"bx req_ack_ALMU\n"+
	"bx cha_ALMU\n"+
	
	"bx req_ack_MURE\n"+
	"bx cha_MURE\n"+
	
	"bx req_ack_REDM\n"+
	"bx cha_REDM\n"+
	
	"bx req_ack_DMAL\n"+
	"bx cha_DMAL\n"+
	
	"bx req_ack_DEPC\n"+
	"bx cha_DEPC\n"+
	
	"bx req_ack_DEAL\n"+
	"bx cha_DEAL\n"+
	
	"$end\n"

)
